<?php namespace Home\Controller; 
use Hdphp\Controller\Controller;
//内容页控制器
class ContentController extends Controller{
	
	//内容页
	public function index(){
//		获得文章的aid
     $aid=Q("get.aid",0,'intval');
	 $arcModel=new \Common\Model\Arc;
//	 刷新浏览次数+1；
     $arcModel->where("aid={$aid}")->increment('click',1);
//	 文章和文章数据表关联
	 $arcData=$arcModel->join("article_data",'aid','=','article_aid')->where("aid=$aid")->find();
//	 标签列表
      $tagModel=new \Common\Model\Tag;	  
	  $tagData=$tagModel->join("article_tag",'tid','=','tag_tid')->where("article_aid=$aid")->lists('tid,tname');	  
	   $tagTagModel=new \Common\Model\ArcTag;
//	   $arcData['tag']=$tagData;
	   $arcData['tag']=$tagTagModel->join('tag','tag_tid','=','tid')->where("article_aid={$aid}")->field('tid,tname')->get();
	
	   View::with('arcData',$arcData);
	 
	 
		View::make();
	}
}
